<?php

/**
 *Index Class of the Index Controller
 * @author ovo
 *
 */

class IndexController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction()
    {
    

}

    

    public function aboutAction()
    {
        // action body
    }

    public function inputAction() {
    	
    	$this->view->form = new Form_ratings();
    
       	if ($this->getRequest()->isPost()){	
       		$rating = new Model_DbTable_rate();
       		$data = $this->getRequest()->getParams();
       		$comm = $data['community'];
       		$stud = $data['student'];
       		$usefulness = $data['usefulness'];
       		$comments = $data['comments']['Editor'];
       		$rating->addRating($comm, $stud, $usefulness, $comments);
       		$this->_forward('thank', 'index', 'default');
       		}    	
    }
    
    public function thankAction(){
    	
    	$this->view->message = "We appreciate your input and would strive to make gradeometer better!";
    }

}



